//
//  CFRMRecipeHistoryCell.swift
//  CrazyFatReducingMeal
//
//  Created by iOS-Czz on 2023/11/8.
//

import UIKit

class CFRMRecipeHistoryCell: UITableViewCell {
    @IBOutlet var dateLabel: UILabel!
    @IBOutlet var nameLabel: UILabel!
    @IBOutlet var breakfastLabel: UILabel!
    @IBOutlet var lunchLabel: UILabel!
    @IBOutlet var dinnerLabel: UILabel!
    
    @IBOutlet var weightLabel: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    var model: CFRMRecipeHistoryModel? {
        didSet {
            self.dateLabel.text = self.model?.date
            self.nameLabel.text = self.model?.recipeName
            self.weightLabel.text = "weight: \(String(format: "%@", self.model!.weight))\nBody fat percentage: \(String(format: "%@", self.model!.percentage))"
            self.breakfastLabel.textColor = self.model!.breakfast ? #colorLiteral(red: 0.2941176471, green: 0.662745098, blue: 0.4156862745, alpha: 1) : #colorLiteral(red: 0.9529411765, green: 0.6470588235, blue: 0.6470588235, alpha: 1)
            self.breakfastLabel.text = self.model!.breakfast ? "Eaten" : "Not eaten"
            self.lunchLabel.textColor = self.model!.lunch ? #colorLiteral(red: 0.2941176471, green: 0.662745098, blue: 0.4156862745, alpha: 1) : #colorLiteral(red: 0.9529411765, green: 0.6470588235, blue: 0.6470588235, alpha: 1)
            self.lunchLabel.text = self.model!.lunch ? "Eaten" : "Not eaten"
            self.dinnerLabel.textColor = self.model!.dinner ? #colorLiteral(red: 0.2941176471, green: 0.662745098, blue: 0.4156862745, alpha: 1) : #colorLiteral(red: 0.9529411765, green: 0.6470588235, blue: 0.6470588235, alpha: 1)
            self.dinnerLabel.text = self.model!.dinner ? "Eaten" : "Not eaten"
            
        }
    }
}
